var $j;
if (!$j) {
	$j = jQuery.noConflict()
};
function save(path, perfix) {
	var list = new Array();
	var objs = $j(':input');
	for ( var i = 0; i < objs.length; i++) {
		if (objs[i].type != 'button' && objs[i].type != 'submit'
				&& objs[i].type != 'reset') {
			list[list.length] = {
				id : objs[i].name,
				value : objs[i].value
			};
		}
	}
	GlobalConfig.setFormListMap(path, perfix, list, function(data) {
		if (data) {
			//saveok
			alert("\u4fdd\u5b58\u6210\u529f!");
		} else {
			//nosave
			alert("\u4fdd\u5b58\u5931\u8d25!");
		}
	});
}
function load(path, perfix) {
	GlobalConfig
			.getFormListMap(
					path,
					perfix,
					function(data) {
						if (data) {
							var configbody = $j('#configbody');
							for ( var i = 0; i < data.length; i++) {
								var ids = data[i].id;
								var reg = new RegExp("\\.", "g");
								var id = ids.replace(reg, "\\.");
								var value = data[i].value;
								if ($j('#' + id).get(0)) {
									$j('#' + id).val(value);
								} else {
									configbody
											.append("<tr><td align='right'>"
													+ ids
													+ ":</td><td><input size='80' type='text' id='"
													+ ids + "' name='" + ids
													+ "' value='" + value
													+ "' /></tr>");
								}
							}
						}
					});
}
